/* power by Solo_Dance */ #include<bits/stdc++.h> #define eps 1e-8 usingnamespacestd; #define ms(a, b) memset((a), (b), sizeof(a)) typedeflonglong ll; typedefunsignedlonglong ull; typedef pair<int, int> P; constint N = 2e5 + 5; constint M = 1e6 + 5; constint INF = 0x3f3f3f3f; const ll ll_max = 0x3f3f3f3f3f3f3f3f; constint mod = 1e9 + 7;
inline ll read(){ ll res = 0;bool f = 0;char ch = getchar(); while (ch < '0' || ch > '9') {if (ch == '-') f = 1;ch = getchar();} while (ch <= '9' && ch >= '0') {res = (res << 3) + (res << 1) + ch - '0';ch = getchar();} return f ? (~res + 1) : res; } int n, m, a[N]; intmain(){ n = read(), m = read(); for (int i = 0; i < n; ++i) a[i] = read();
if (n > m) puts("0"); else{ ll ans = 1; for (int i = 0; i < n; ++i){ for (int j = i + 1; j < n; ++j){ ans = ans * abs(a[i] - a[j]) % m; } } cout << ans << "\n"; } return0; }